package tail.utils;

/**
 * Contains each property used for the project.
 * @author Michael Sena
 * @version 1.1
 */
public enum Property {
    // TODO: Work out a good default directory.
    /** Initial location for opening log files. */
    INITIAL_DIRECTORY(Area.GENERAL, "initialDirectory", "C:\\");

    /**
     * Allows each property to be created.
     * @param area Group/area of property
     * @param propName Name of property
     * @param propDefaultValue Initial value
     */
    private Property(final String area, final String propName,
            final String propDefaultValue) {
        name = area + "." + propName;
        defaultValue = propDefaultValue;
    }

    /** Name of the property. */
    private final String name;

    /** Default value for the property. */
    private final String defaultValue;

    @Override
    public String toString() {
        return this.name;
    }

    /**
     * Retrieves the stored default value.
     * @return Default value for the property
     */
    public String getDefaultValue() {
        return this.defaultValue;
    }

    /** Different areas/group of properties. */
    abstract static class Area {
        /** Name of the area. */
        public static final String GENERAL = "general";

        /** Private constructor (complies with check-style practices). */
        private Area() { }
    }
}
